﻿@model MSAcademic.v2.Web.Models.Home.SubSectionsViewModel
@{
    ViewBag.Title = "SubSections";
}

<h2>SubSections</h2>
@using(Html.BeginForm())
{
    @Html.HiddenFor(m=>m.SubSectionId)
    @Html.HiddenFor(m=>m.SelectedTagsCsv)

    /* Trebalo bi formu submitat automatski na promjenu taga da se mogu filtrirat novosti!  Ajax za dobavljanje novosti mozda :/?*/
}
@Model.SubSection.Item1.Name  @Model.SubSection.Item2.Name
    <div class="clearfix">
        <div class="tag-cloud-wrapper tagsMultipleItemSelector">
                <ul>
                @foreach (var tag in Model.AllTags)
                {
                    <li> <a data-id="@tag.Id" class="item bound"> @tag.Name </a> </li>
                } 
                </ul>

                @Html.HiddenFor(x => x.SelectedTagsCsv)
            </div>
    </div>
@foreach(var tag in Model.SelectedTags)
{
    <div>@tag.Name </div>

    
    
}

@foreach(var item in Model.ArticlesForSubSection)
{
    <div>
        @Html.Raw(item.Item1.Title)
        <div> Piše: @item.Item2.FirstName @item.Item2.LastName </div>
        <div>  @Html.Raw(item.Item1.ShortText)</div>
       
        <div> @item.Item1.PublishedOn </div>
       
    </div>
    <br/>
    
}

